<?php

namespace ProjetA\GroupeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use ProjetA\GroupeBundle\Entity\Groupe as Groupe;

/**
 * ProjetA\GroupeBundle\Entity\Post
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="ProjetA\GroupeBundle\Entity\PostRepository")
 */
class Post {

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var text $post
     *
     * @ORM\Column(name="post", type="text")
     */
    private $post;

    /**
     * @var datetime $date_creation
     *
     * @ORM\Column(name="date_creation", type="datetime")
     */
    private $date_creation;

    /**
     * @ORM\ManyToOne(targetEntity="ProjetA\UserBundle\Entity\User", inversedBy="posts")
     */
    private $user;

    /**
     * @ORM\ManyToOne(targetEntity="ProjetA\GroupeBundle\Entity\Groupe", inversedBy="posts")
     */
    private $groupe;

    public function getGroupe() {
        return $this->groupe;
    }

    public function setGroupe($groupe) {
        $this->groupe = $groupe;
    }

    public function getUser() {
        return $this->user;
    }

    public function setUser($user) {
        $this->user = $user;
        $this->user->addPost($this);
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set post
     *
     * @param text $post
     */
    public function setPost($post) {
        $this->post = $post;
    }

    /**
     * Get post
     *
     * @return text 
     */
    public function getPost() {
        return $this->post;
    }

    /**
     * Set date_creation
     *
     * @param datetime $dateCreation
     */
    public function setDateCreation($dateCreation) {
        $this->date_creation = $dateCreation;
    }

    /**
     * Get date_creation
     *
     * @return datetime 
     */
    public function getDateCreation() {
        return $this->date_creation;
    }

}